package com.sjy.ylxt.service.impl;


import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import com.sjy.ylxt.mapper.YlxtAppointmentDetailsMapper;
import com.sjy.ylxt.entity.domain.YlxtAppointmentDetails;
import com.sjy.ylxt.service.YlxtAppointmentDetailsService;

import javax.annotation.Resource;

/**
* @Author: 史俊颖
* @CreateTime: 2024-12-12
* @Description: ${description}
*/
@Service
public class YlxtAppointmentDetailsServiceImpl extends ServiceImpl<YlxtAppointmentDetailsMapper, YlxtAppointmentDetails> implements YlxtAppointmentDetailsService{

    @Resource
    private YlxtAppointmentDetailsMapper ylxtAppointmentDetailsMapper;

    @Override
    public int deleteByPrimaryKey(Long id) {
        return ylxtAppointmentDetailsMapper.deleteByPrimaryKey(id);
    }

    @Override
    public int insert(YlxtAppointmentDetails record) {
        return ylxtAppointmentDetailsMapper.insert(record);
    }

    @Override
    public int insertSelective(YlxtAppointmentDetails record) {
        return ylxtAppointmentDetailsMapper.insertSelective(record);
    }

    @Override
    public YlxtAppointmentDetails selectByPrimaryKey(Long id) {
        return ylxtAppointmentDetailsMapper.selectByPrimaryKey(id);
    }

    @Override
    public int updateByPrimaryKeySelective(YlxtAppointmentDetails record) {
        return ylxtAppointmentDetailsMapper.updateByPrimaryKeySelective(record);
    }

    @Override
    public int updateByPrimaryKey(YlxtAppointmentDetails record) {
        return ylxtAppointmentDetailsMapper.updateByPrimaryKey(record);
    }

    @Override
    public Object detail(String id) {
        try {
            LambdaQueryWrapper<YlxtAppointmentDetails> qw = new LambdaQueryWrapper<>();
            qw.eq(YlxtAppointmentDetails::getAppointmentId,id);
            YlxtAppointmentDetails ylxtAppointmentDetails = ylxtAppointmentDetailsMapper.selectOne(qw);
            return ylxtAppointmentDetails;
        } catch (Exception e) {
            e.printStackTrace();
        }
        return null;
    }

    /**
     * @param entity
     * @return
     */
    @Override
    public boolean save(YlxtAppointmentDetails entity) {
        return super.save(entity);
    }
}
